package cn.nfwx.tv.manager;

import android.content.Context;

import cn.nfwx.tv.callback.ResponseListener;
import cn.nfwx.tv.callback.ResponseWithFailListener;
import cn.nfwx.tv.conts.Constants;
import cn.nfwx.tv.okhttp.CustomOkHttpClient;
import cn.nfwx.tv.okhttp.UrlHelper;

/**
 * Created by zhouzechao on 2017/11/21.
 */

public class TimelineManager {

    /**
     * @param path
     * @return
     */
    public static String requestTimeliveLiveDetail(Context context, String path, ResponseListener callBack) {
        String request_tag = "requestTimeliveLiveDetail";
        CustomOkHttpClient.cancleAll(request_tag);
        String url = Constants.base_video_url + path + ".json?type=live";
        CustomOkHttpClient.postObjectRequest(context, url, request_tag, callBack);
        return request_tag;
    }

    /**
     * @param context
     * @param path
     * @param callBack
     * @return
     */
    public static String requestTimelineImageTimeCodes(Context context, String path, ResponseListener callBack) {
        String request_tag = "requestTimelineImageTimeCodes";
        CustomOkHttpClient.cancleAll(request_tag);
        String url = "http://m3.southtv.live:9083/live/lvmgr1-live1/" + path + "/live.tl.json";
        CustomOkHttpClient.postObjectRequest(context, url, request_tag, callBack);
        return request_tag;
    }

    /**
     * @param context
     * @param playVsid
     * @param tiemCode
     * @param callBack
     * @return
     */
    public static String requestTimelineImageThumbs(Context context, int playVsid, int tiemCode, ResponseListener callBack) {
        String request_tag = "requestTimelineImageThumbs";
        return request_tag;
    }

    /**
     * 剪辑
     *
     * @param context
     * @param gid
     * @param callBack
     * @return
     */
    public static String requestLiveClipsnap(Context context, String gid, ResponseWithFailListener<String> callBack) {
        String request_tag = "requestLiveClipsnap";
        CustomOkHttpClient.cancleAll(request_tag);
        String url = UrlHelper.getClipsnapUrl(gid);
        CustomOkHttpClient.getObjectRequest(context, url, request_tag, callBack);
        return request_tag;
    }
}
